﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects
{
    public class AudittingLog : BusinessObject
    {
        public AudittingLog()
        {
            AddRule(new ValidateRequired("LoginName"));
            AddRule(new ValidateLength("LoginName", 0, 50));

            AddRule(new ValidateRequired("ComponentName"));
            AddRule(new ValidateLength("ComponentName", 0, 50));

            AddRule(new ValidateRequired("RestaurantID"));
        }

        public AudittingLog(string eventID, string loginName, string computerName, string fullName, 
                        DateTime time, int action, string reference, decimal amount, string restaurantID)
            : this()
        {
            EventID = eventID;
            LoginName = loginName;
            ComputerName = computerName;
            FullName = FullName;
            Time = time;
            Action = action;
            Reference = reference;
            Amount = amount;
            RestaurantID = restaurantID;
        }

        public string EventID { get; set; }

        public string LoginName { get; set; }

        public string ComputerName { get; set; }

        public string FullName { get; set; }

        public DateTime Time { get; set; }

        public int Action { get; set; }

        public string Reference { get; set; }

        public decimal Amount { get; set; }

        /// <summary>
        /// RestaurantID cập nhật theo chuỗi đã có nên sẽ để kiểu string 
        /// </summary>
        public string RestaurantID { get; set; } 
    }
}
